#include<iostream>

using namespace std;

const int N = 1e6 + 10;

int n , m;
int a[N] , mp[N];
int kind;

int main()
{
    cin >> n >> m;
    for(int i = 1;i <= n;i ++) cin >> a[i];
    int left = 1 , right = 1;
    int ret = n , begin = 1;
    while(right <= n)
    {
        //进窗口
        if(mp[a[right]] ++ == 0) kind++;
        //判断
        while(kind == m)
        {
            //更新结果
            int len = right - left + 1;
            if(len < ret)
            {
                ret = len;
                begin = left;
            }
            //出窗口
            if(mp[a[left]] -- == 1) kind--;
            left++;
        }
        right++;
    }
    cout << begin << " " << begin + ret - 1 << endl;
    return 0;
}